import express from 'express';
import { register, login, getUserProfile, updateUserProfile } from '../controllers/userController';
import { protect } from '../middleware/auth';

const router = express.Router();

// 公开路由
router.post('/register', register);
router.post('/login', login);

// 需要认证的路由
router.get('/profile/:id', protect, getUserProfile);
router.put('/profile/:id', protect, updateUserProfile);

export default router; 